From 669d068594e9882226ccd721d5c3bba508ca5d03 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 3 Nov 2004 17:06:38 +0000 Subject: [PATCH] Handle the case that the protocol version in the context is not set yet. 2004-11-03 Matthias Clasen * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the case that the protocol version in the context is not set yet. (#157123, James Henstridge) --- ChangeLog | 4 ++++ ChangeLog.pre-2-10 | 4 ++++ ChangeLog.pre-2-6 | 4 ++++ ChangeLog.pre-2-8 | 4 ++++ gdk/x11/gdkdnd-x11.c | 22 +++++++++++++++++++++- 5 files changed, 37 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0f5ebd5b39..dd1f43ce11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2004-11-03 Matthias Clasen + * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the + case that the protocol version in the context is not + set yet. (#157123, James Henstridge) + * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't try to activate a node if the cursor is not valid. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0f5ebd5b39..dd1f43ce11 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ 2004-11-03 Matthias Clasen + * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the + case that the protocol version in the context is not + set yet. (#157123, James Henstridge) + * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't try to activate a node if the cursor is not valid. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0f5ebd5b39..dd1f43ce11 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,9 @@ 2004-11-03 Matthias Clasen + * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the + case that the protocol version in the context is not + set yet. (#157123, James Henstridge) + * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't try to activate a node if the cursor is not valid. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0f5ebd5b39..dd1f43ce11 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ 2004-11-03 Matthias Clasen + * gdk/x11/gdkdnd-x11.c (gdk_drag_motion): Handle the + case that the protocol version in the context is not + set yet. (#157123, James Henstridge) + * gtk/gtktreeview.c (gtk_tree_view_search_activate): Don't try to activate a node if the cursor is not valid. diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c index 5eb2cd7ddf..4a7a599851 100644 --- a/gdk/x11/gdkdnd-x11.c +++ b/gdk/x11/gdkdnd-x11.c @@ -3231,7 +3231,27 @@ gdk_drag_motion (GdkDragContext *context, if (private->old_actions != possible_actions) private->xdnd_actions_set = FALSE; - + + if (protocol == GDK_DRAG_PROTO_XDND && private->version == 0) + { + /* This ugly hack is necessary since GTK+ doesn't know about + * the XDND protocol version, and in particular doesn't know + * that gdk_drag_find_window_for_screen() has the side-effect + * of setting private->version, and therefore sometimes call + * gdk_drag_motion() without a prior call to + * gdk_drag_find_window_for_screen(). This happens, e.g. + * when GTK+ is proxying DND events to embedded windows. + */ + if (dest_window) + { + GdkDisplay *display = GDK_WINDOW_DISPLAY (dest_window); + + xdnd_check_dest (display, + GDK_DRAWABLE_XID (dest_window), + &private->version); + } + } + /* When we have a Xdnd target, make sure our XdndActionList * matches the current actions; */ -- 2.30.2